﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Downplay.Gravity.Drivers;
using Orchard.Environment.Extensions;

namespace Downplay.Relativity.Drops.Drivers
{
    /// <summary>
    /// Anything with sockets part gets a handle to drag them to receiving sockets
    /// </summary>
    [OrchardFeature("Downplay.Relativity.Drops")]
    public class SocketsDragHandleDriver : DragHandleDriver
    {


        public override IEnumerable<string> ForShapes()
        {
            // Applies purely to the sockets shape (which should be singular per SocketsPart)
            yield return "Sockets";
        }

        protected override string Identifier(Gravity.Events.ShapeDataContext context)
        {
            return context.Shape.ContentItem.Id;
        }

        protected override void OnModifyData(Gravity.Events.ShapeDataContext context, Gravity.Events.ShapeDataDecoration dec)
        {
            // Ignore for now
        }
    }
}